package at.ac.univie.zsu.aguataplan.ui;

import javax.swing.JDialog;
import javax.swing.JProgressBar;

import at.ac.univie.zsu.aguataplan.property.GeneralProperties;
import at.ac.univie.zsu.aguataplan.property.I18nProperties;

/**
 * @author gerry
 * 
 */
public class DialogWait extends JDialog implements UIConstants {

	private static final long serialVersionUID = 1L;

	private I18nProperties i18nProp;

	private JProgressBar progressBar;

	// ----------------------------------------------------
	// CONSTRUCTOR
	// ----------------------------------------------------

	/** Creates new form JDialogWait */
	public DialogWait(DialogGame parent, GeneralProperties generalProperties, boolean modal) {
		super(parent, modal);

		this.i18nProp = generalProperties.getI18nProperties();

		this.setLayout(null);

		this.setLocationRelativeTo(parent);

		progressBar = new JProgressBar();

		setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
		setTitle(i18nProp.getString(WAIT_NAME));
		setResizable(false);

		setSize(HEADER_X + SPACING + PROGRESS_BAR_X + SPACING, HEADER_Y + SPACING + PROGRESS_BAR_Y + SPACING);

		progressBar.setSize(PROGRESS_BAR_X, PROGRESS_BAR_Y);
		progressBar.setLocation(SPACING, SPACING);
		this.add(progressBar);

	}

	// ----------------------------------------------------
	// METHODS
	// ----------------------------------------------------

	public void setProgressValue(int value) {
		progressBar.setValue(value);
	}

}
